package com.jxin.mall.member.service;

import com.jxin.mall.member.feign.WeiXinAppServiceFeign;
import com.jxin.mall.member.service.api.MemberService;
import com.jxin.mall.weixin.service.entity.App;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 会员服务实现类
 * @author 蔡佳新
 * @version 1.0
 * @since jdk 1.8
 * @date 2019/5/27 23:15
 */
@RestController
@Slf4j
public class MemberServiceImpl implements MemberService {
    @Resource
    private WeiXinAppServiceFeign weiXinAppServiceFeign;
    @HystrixCommand
    @GetMapping(value = "/memberInvokeWeixin", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @Override
    public App memberInvokeWeixin() {
        log.error("memberInvokeWeixin:" + "线程池名称:" + Thread.currentThread().getName());
        return weiXinAppServiceFeign.getApp();
    }
}
